/*
 * Powered By [rapid-framework]
 * Web Site: http://www.rapid-framework.org.cn
 * Google Code: http://code.google.com/p/rapid-framework/
 * Since 2008 - 2015
 */

package com.environment_pro.monitor.model;

import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ToStringStyle;

import org.springframework.format.annotation.DateTimeFormat;
import com.fasterxml.jackson.annotation.JsonFormat;

import com.environment_pro.monitor.util.StaticUtil;

/**
 * @author yangfeng 
 * @version 1.0
 * @since 1.0
 */


public class TbLogLogin implements java.io.Serializable{

	private static final long serialVersionUID = 5454155825314635342L;
	
	//alias
	public static final String TABLE_ALIAS = "TbLogLogin";
	public static final String ALIAS_ID = "id";
	public static final String ALIAS_USER_ID = "用户ID";
	public static final String ALIAS_USERNAME = "用户名称";
	public static final String ALIAS_REAL_NAME = "用户名称";
	public static final String ALIAS_LOGIN_DATE = "登录时间";
	public static final String ALIAS_LOGIN_IP = "登录Ip";
	public static final String ALIAS_LOGIN_USER_AGENT = "浏览器信息";
	public static final String ALIAS_LOGIN_SESSION_ID = "回话ID";
	public static final String ALIAS_LOGIN_HOST_NAME = "客户端主机名";
	public static final String ALIAS_ADD_TIME = "入库时间";
	
	
	
	//可以直接使用: @Length(max=50,message="用户名长度不能大于50")显示错误消息
	//columns START
	private java.lang.Integer id;

	private java.lang.Integer userId;

	private java.lang.String username;

	private java.lang.String realName;

	@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") 
    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
	private  java.util.Date loginDate;

	private java.lang.String loginIp;

	private java.lang.String loginUserAgent;

	private java.lang.String loginSessionId;

	private java.lang.String loginHostName;

	@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") 
    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
	private  java.util.Date addTime;

	//columns END

	//date String
	@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") 
    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
	private java.util.Date loginDateBegin;

	@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") 
    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
	private java.util.Date loginDateEnd;
	@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") 
    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
	private java.util.Date addTimeBegin;

	@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") 
    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
	private java.util.Date addTimeEnd;

	public TbLogLogin(){
	}

	public TbLogLogin(
		java.lang.Integer id
	){
		this.id = id;
	}

	public void setId(java.lang.Integer value) {
		this.id = value;
	}
	
	public java.lang.Integer getId() {
		return this.id;
	}
	public void setUserId(java.lang.Integer value) {
		this.userId = value;
	}
	
	public java.lang.Integer getUserId() {
		return this.userId;
	}
	public void setUsername(java.lang.String value) {
		this.username = value;
	}
	
	public java.lang.String getUsername() {
		return this.username;
	}
	public void setRealName(java.lang.String value) {
		this.realName = value;
	}
	
	public java.lang.String getRealName() {
		return this.realName;
	}

	public void setLoginDateBegin(java.util.Date value) {
		this.loginDateBegin = value;
	}
	
	public java.util.Date getLoginDateBegin() {
		return this.loginDateBegin;
	}

	public void setLoginDateEnd(java.util.Date value) {
		this.loginDateEnd = value;
	}
	
	public java.util.Date getLoginDateEnd() {
		return this.loginDateEnd;
	}
	
	public void setLoginDate(java.util.Date value) {
		this.loginDate = value;
	}
	
	public java.util.Date getLoginDate() {
		return this.loginDate;
	}
	public void setLoginIp(java.lang.String value) {
		this.loginIp = value;
	}
	
	public java.lang.String getLoginIp() {
		return this.loginIp;
	}
	public void setLoginUserAgent(java.lang.String value) {
		this.loginUserAgent = value;
	}
	
	public java.lang.String getLoginUserAgent() {
		return this.loginUserAgent;
	}
	public void setLoginSessionId(java.lang.String value) {
		this.loginSessionId = value;
	}
	
	public java.lang.String getLoginSessionId() {
		return this.loginSessionId;
	}
	public void setLoginHostName(java.lang.String value) {
		this.loginHostName = value;
	}
	
	public java.lang.String getLoginHostName() {
		return this.loginHostName;
	}

	public void setAddTimeBegin(java.util.Date value) {
		this.addTimeBegin = value;
	}
	
	public java.util.Date getAddTimeBegin() {
		return this.addTimeBegin;
	}

	public void setAddTimeEnd(java.util.Date value) {
		this.addTimeEnd = value;
	}
	
	public java.util.Date getAddTimeEnd() {
		return this.addTimeEnd;
	}
	
	public void setAddTime(java.util.Date value) {
		this.addTime = value;
	}
	
	public java.util.Date getAddTime() {
		return this.addTime;
	}

	public String toString() {
		return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
			.append("Id",getId())
			.append("UserId",getUserId())
			.append("Username",getUsername())
			.append("RealName",getRealName())
			.append("LoginDate",getLoginDate())
			.append("LoginIp",getLoginIp())
			.append("LoginUserAgent",getLoginUserAgent())
			.append("LoginSessionId",getLoginSessionId())
			.append("LoginHostName",getLoginHostName())
			.append("AddTime",getAddTime())
			.toString();
	}
	
	public int hashCode() {
		return new HashCodeBuilder()
			.append(getId())
			.toHashCode();
	}
	
	public boolean equals(Object obj) {
		if(obj instanceof TbLogLogin == false) return false;
		if(this == obj) return true;
		TbLogLogin other = (TbLogLogin)obj;
		return new EqualsBuilder()
			.append(getId(),other.getId())
			.isEquals();
	}
}

